using System;

namespace Qplus.protocol
{
    /**
     * 
     * 发送消息请求
     *
     */
    public class C2U_REQ_ROOM_SENDMSG : OutPacket{

	    /**
	     * 发送文本
	     * 
	     * @param roomID
	     * @param messageType
	     * @param data
	     * @param dlen
	     * @return
	     */
	    public C2U_REQ_ROOM_SENDMSG sendMessage(long roomID, int messageType, byte[] data, int dlen){
		    init();
		    needReply = true;
		    int len = 0;
		    len += put4(roomID);
		    len += put1((byte) messageType);
		    len += put2(dlen);
		    len += putN(data, 0, dlen);
		
		    postLen(len);
		    return this;
	    }
    }

}
